package com.itheima.开启多线程.myrunnable;

/**
 * @Author 王加鑫
 * @Date 2021/5/22 10:19
 * @Version 1.0
 */
public class Demo02 {
    public static void main(String[] args) {
        //创建线程类参数的对象
        MyRunnable runnable = new MyRunnable();
        //将参数传入线程类
        Thread thread = new Thread(runnable);
        //开启线程
        thread.setName("MyRunnable");
        thread.start();

        //创建线程类参数的对象
        MyRunnable runnable2 = new MyRunnable();
        //将参数传入线程类
        Thread thread2 = new Thread(runnable);
        //开启线程
        thread2.setName("MyRunnable2");
        thread2.start();

    }
}
